﻿using System;

namespace Snake.Gameplay.EffectComponents
{
    [Serializable]
    public class TargetTags : GameplayEffectComponent
    {
        public string added;
        public string removed;

        public string[] CombinedTags => new [] { added };

        public override void Add(GameplayEffectSpec spec)
        {
            foreach (var tag in CombinedTags)
            {
                spec.Owner.TagContainer.AddTag(tag);
            }
        }

        public override void Remove(GameplayEffectSpec spec)
        {
            foreach (var tag in CombinedTags)
            {
                spec.Owner.TagContainer.RemoveTag(tag);
            }
        }
    }
}